package com.andersen.database.datatable;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Corvin on 27.06.14.
 */
public class TableParam {

    public static final int IGNORE_PAGINATION = -1;
    public static final int IGNORE_SORTING = -1;

    public static final String FILTER_FROM_DATE = "fromDate";
    public static final String FILTER_TO_DATE = "toDate";

    private int offset;

    private int count;

    private int sortColumnNumber;

    private boolean sortAsc = true;

    private Map<String, Object> filterParams = new HashMap<String, Object>();

    public int getOffset() {
        return offset;
    }

    public void setOffset(int offset) {
        this.offset = offset;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public int getSortColumnNumber() {
        return sortColumnNumber;
    }

    public void setSortColumnNumber(int sortColumnNumber) {
        this.sortColumnNumber = sortColumnNumber;
    }

    public boolean isSortAsc() {
        return sortAsc;
    }

    public void setSortAsc(boolean sortAsc) {
        this.sortAsc = sortAsc;
    }

    public Map<String, Object> getFilterParams() {
        return filterParams;
    }

    public void setFilterParams(Map<String, Object> filterParams) {
        this.filterParams = filterParams;
    }

    @Override
    public String toString() {
        return "TableParam{" +
                "offset=" + offset +
                ", count=" + count +
                ", sortColumnNumber=" + sortColumnNumber +
                ", sortAsc=" + sortAsc +
                ", filterParams=" + filterParams +
                '}';
    }
}
